package com.baitiaojun.video.mapper;

import com.baitiaojun.api.domain.video.VideoComment;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface VideoCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(VideoComment record);

    int insertSelective(VideoComment record);

    VideoComment selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(VideoComment record);

    int updateByPrimaryKeyWithBLOBs(VideoComment record);

    int updateByPrimaryKey(VideoComment record);

    Integer isExistsById(Long id);

    Integer isExistsByVideoIdAndRootId(@Param("videoId") Long videoId, @Param("rootId") Long rootId);

    Integer isExistsByVideoIdAndUserId(@Param("videoId") Long videoId, @Param("userId") Long userId);

    int deleteChildByIdAndUserId(@Param("id") Long id, @Param("userId") Long userId);

    int deleteByIdAndUserId(@Param("id") Long id, @Param("userId") Long userId);

    void batchDeleteByRootIdAndReplyUserId(@Param("id") Long id, @Param("userId") Long userId);

    List<VideoComment> batchVideoCommentCount(@Param("videoIds") Set<Long> videoIds);

    VideoComment selectVideoCommentById(@Param("id") Long id);

    Integer selectVideoCommentCount(Long videoId);
}